import instance  from "@/until/request";

export const swiper=()=>{
    return instance.get('/home/swiper')
}

export const rentHome=()=>{
    return instance.get('/home/groups')
}

export const message=()=>{
    return instance.get('/home/news')
}

export const login=data=>{
    return instance.post('/user/registered',data)
}

export const register=(data)=>{
    return instance.post('/user/login',data)
}

export const citylist=(num)=>{
    return instance.get('/area/city',{params:{level:num}})
}

export const user=()=>{
    return instance.get('/user')
}

export const house=(id)=>{
    return instance.get('/houses',{
        params:{
            cityId:id||'AREA|dbf46d32-7e76-1196'
        }
    })
}

//区域
 export const condition=(value)=>{
    return instance.get('/houses/condition',{
        params:{
            id:value||'AREA|dbf46d32-7e76-1196'
        }
    })
 }

 //单个房屋详情
export const detailHome=(id)=>{
    return instance.get('/houses/'+id)
}

//收藏
export const collect=(code)=>{
    return instance.post('/user/favorites/'+code)
}

//取消收藏
export const canlcollect=(code)=>{
    return instance.delete('/user/favorites/'+code)
}

//是否收藏
export const yncollect=(code)=>{
    return instance.get('/user/favorites/'+code)
}

//获取收藏
export const getcollect=()=>{
     return instance.get('/user/favorites')
}